/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.server.virtual.controller;

import java.io.InputStream;
import javax.servlet.http.HttpServletRequest;
import offset.nodes.server.controller.ActionCommandForm;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author Walter Lütgenau
 */
public class VirtualForm extends ActionCommandForm {
    InputStream html;
    String id;
    String ref = null;
    String vref = null;
    String dir = null;
    String result = null;
    public static final String MODE_USER = "user";
    public static final String MODE_APPLET = "applet";
    private String mode;
    public static final int EDIT = 1;
    public static final int REMOVE = 2;
 
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    
    public InputStream getHtml() {
        return html;
    }

    public void setHtml(InputStream html) {
        this.html = html;
    }
    
    public String getMode() {
        return mode;
    }
    
    public void setMode(String mode) {
        this.mode = mode;
    }
    
    public void setEdit(String edit) {
        action = EDIT;
    }
    
    public void setRemove(String remove) {
        action = REMOVE;
    }
    
    public String getRef() {
        return ref;
    }

    public void setRef(String ref) {
        this.ref = ref;
    }

    public String getVref() {
        return vref;
    }

    public void setVref(String vref) {
        this.vref = vref;
    }

    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }
    
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        setMode(MODE_USER);
        ref = vref = dir = result = null;
    }

    

 }
